home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Optimisation & Diagnostics / UpdateStar 2.5 / UpdateStar_ENU.msi / NewsXsl < prev    next >
Extensible Markup Language  |  2008-04-16  |  8KB  |  289 lines

  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.  
  4. <xsl:template match="servernews/stylepath"></xsl:template>
  5. <xsl:template match="servernews/language"></xsl:template>
  6. <xsl:template match="servernews/largefont"></xsl:template>
  7.  
  8.  
  9.  
  10. <xsl:variable name="language"><xsl:value-of select="servernews/language"/></xsl:variable>
  11. <xsl:variable name="stylepathorig"><xsl:value-of select="servernews/stylepath"/></xsl:variable>
  12. <xsl:variable name="largefont"><xsl:value-of select="servernews/largefont"/></xsl:variable>
  13. <xsl:variable name="stylepath"><xsl:copy-of select="$stylepathorig"/>\img\</xsl:variable>
  14.  
  15.  
  16. <xsl:template match="servernews/newslist">
  17.  
  18. <html><head>
  19. <xsl:element name="link">
  20.     <xsl:attribute name="href"><xsl:copy-of select="$stylepathorig"/>/style.css</xsl:attribute>
  21.     <xsl:attribute name="rel">stylesheet</xsl:attribute>
  22.     <xsl:attribute name="type">text/css</xsl:attribute>
  23. </xsl:element>
  24.  
  25. <xsl:if test="$largefont='yes'">
  26.     <style type="text/css">
  27.         td     {
  28.             font-size: 15px;
  29.         }
  30.         
  31.         td.desc{
  32.             font-size:13px;
  33.         }
  34.         td.normal{
  35.             font-size:13px;
  36.         }
  37.         td.normalbig{
  38.             font-size:13px;
  39.         }
  40.         a.sublink{
  41.             font-size:11px;
  42.             font-weight:bold;
  43.         }
  44.     </style>
  45. </xsl:if>
  46.  
  47.  
  48. <!--
  49. <xsl:element name="SCRIPT">
  50.     <xsl:attribute name="language">JavaScript</xsl:attribute>
  51.     <xsl:attribute name="SRC"><xsl:copy-of select="$stylepathorig"/>\<xsl:copy-of select="$language"/>.js</xsl:attribute>
  52. </xsl:element>
  53.  
  54.  
  55. <xsl:element name="SCRIPT">
  56.     <xsl:attribute name="language">JavaScript</xsl:attribute>
  57.     <xsl:attribute name="SRC"><xsl:copy-of select="$stylepathorig"/>\slang.js</xsl:attribute>
  58. </xsl:element>
  59. -->
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69. <xsl:element name="SCRIPT">
  70.     <xsl:attribute name="language">JavaScript</xsl:attribute>
  71. function translate(){
  72.     for (newalt in sfields) {
  73.     
  74.     sfields[newalt] = window.external.GetString(sfields[newalt]);
  75.     
  76.         if(document.getElementById(newalt) ){
  77.             if(document.getElementById(newalt).alt){//image
  78.                 document.getElementById(newalt).alt=sfields[newalt];
  79.             }else if(document.getElementById(newalt).value == ""){//input
  80.                 document.getElementById(newalt).value=sfields[newalt];
  81.             }else{
  82.                 document.getElementById(newalt).innerHTML=sfields[newalt];//default div element
  83.             }
  84.         }
  85.  
  86.             if(document.getElementById(newalt + "_" + 0)){
  87.                 document.getElementById(newalt + "_" + 0).innerHTML=sfields[newalt];
  88.             }
  89.             
  90.             if(document.getElementById(newalt + "_" + 1)){
  91.                 document.getElementById(newalt + "_" + 1).innerHTML=sfields[newalt];
  92.             }
  93.             
  94.             if(document.getElementById(newalt + "_" + 2)){
  95.                 document.getElementById(newalt + "_" + 2).innerHTML=sfields[newalt];
  96.             }
  97.             
  98.             if(document.getElementById(newalt + "_" + 3)){
  99.                 document.getElementById(newalt + "_" + 3).innerHTML=sfields[newalt];
  100.             }
  101.             
  102.             if(document.getElementById(newalt + "_" + 4)){
  103.                 document.getElementById(newalt + "_" + 4).innerHTML=sfields[newalt];
  104.             }
  105.             
  106.             if(document.getElementById(newalt + "_" + 5)){
  107.                 document.getElementById(newalt + "_" + 5).innerHTML=sfields[newalt];
  108.             }
  109.                 
  110.         }
  111. }
  112.  
  113.  
  114. var sfields = new Array();
  115.  
  116.  
  117. sfields["str_noupdate"]        = 600;
  118. sfields["str_yesupdate"]    = 601;
  119. sfields["str_lastscan"]        = 602;
  120. sfields["str_foundprogs"]    = 603;
  121. sfields["str_foundupdates"]    = 604;
  122. sfields["searchbutton"]        = 605;
  123. sfields["listbutton"]        = 606;
  124. sfields["str_availupdates"]    = 607;
  125. sfields["str_availvers"]    = 608;
  126. sfields["str_availnews"]    = 609;
  127. sfields["str_pname"]        = 610;
  128. sfields["str_publisher"]    = 611;
  129. sfields["str_category"]     = 612;
  130. sfields["str_license"]         = 613;
  131. sfields["str_irequirements"]= 614;
  132. sfields["str_iversion"]     = 615;
  133. sfields["str_uversion"]     = 616;
  134. sfields["str_management"]     = 617;
  135. sfields["str_info"]         = 618;
  136. sfields["str_sdesc"]         = 619;
  137. sfields["str_desc"]         = 620;
  138. sfields["str_download"]     = 621;
  139. sfields["str_buynow"]         = 622;
  140. sfields["str_getprice"]     = 623;
  141. sfields["str_buyfrom"]         = 624;
  142. sfields["str_errlink"]         = 625;
  143. sfields["str_sendupdate"]     = 626;
  144. sfields["sendupdate"]         = 626;
  145. sfields["alt_uninstall"]    = 627;
  146. sfields["alt_repair"]         = 629;
  147. sfields["alt_modify"]         = 628;
  148. sfields["str_ranking"]         = 630;
  149. sfields["str_allranking"]     = 631;
  150. sfields["str_newstitle"]    = 632;
  151. sfields["str_newsdata"]     = 633;
  152. sfields["str_comment"]         = 636;
  153. sfields["str_updatetop"]     = 634;
  154. sfields["str_changevalues"] = 635;
  155.  
  156. </xsl:element>
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172. </head>
  173.  
  174. <body onload="if(window.translate)translate(); ">
  175.  
  176.  
  177.  
  178.  
  179. <table border="0" cellpadding="0" cellspacing="0" width="100%">
  180.                         <tr>
  181.                             <td class="tl">
  182.                                 <xsl:element name="img">
  183.                                     <xsl:attribute name="src"><xsl:copy-of select="$stylepath"/>/tbl/shim.gif</xsl:attribute>
  184.                                     <xsl:attribute name="width">2</xsl:attribute>
  185.                                     <xsl:attribute name="height">2</xsl:attribute>
  186.                                 </xsl:element>
  187.                             </td><td class="tm" width="100%"></td>
  188.                             <td class="tr">
  189.                                 <xsl:element name="img">
  190.                                     <xsl:attribute name="src"><xsl:copy-of select="$stylepath"/>/tbl/shim.gif</xsl:attribute>
  191.                                     <xsl:attribute name="width">2</xsl:attribute>
  192.                                     <xsl:attribute name="height">2</xsl:attribute>
  193.                                 </xsl:element>
  194.                             </td>
  195.                         </tr>
  196.                         <tr>
  197.                             <td class="ml"></td>
  198.                             <td width="100%" class="wbox">
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206. <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
  207.     <tr><td valign="top" >
  208.         <table border="0" cellpadding="5" cellspacing="0" width="100%">
  209.             <TR><TD style="white-space: nowrap;padding-left:30px;"><b><div id="str_newsdata">.</div></b></TD>
  210.             <TD width="70%" style="white-space: nowrap;"><b><div id="str_newstitle">.</div></b></TD></TR>
  211.             <xsl:apply-templates />
  212.         </table>
  213.     </td></tr>
  214. </table>
  215.  
  216.  
  217.                             </td>
  218.                             <td class="mr"></td>
  219.                         </tr>
  220.                         <tr>
  221.                             <td class="ml"></td>
  222.                             <td valign="top" class="wbox">
  223.                                 <xsl:element name="img">
  224.                                     <xsl:attribute name="border">0</xsl:attribute>
  225.                                     <xsl:attribute name="align">right</xsl:attribute>
  226.                                     <xsl:attribute name="src"><xsl:copy-of select="$stylepath"/>star.gif</xsl:attribute>
  227.                                 </xsl:element>
  228.                             </td>
  229.                             <td class="mr"></td>
  230.                         </tr>    
  231.                         <tr>
  232.                             <td class="bl">
  233.                                 <xsl:element name="img">
  234.                                     <xsl:attribute name="src"><xsl:copy-of select="$stylepath"/>/img/tbl/shim.gif</xsl:attribute>
  235.                                     <xsl:attribute name="width">2</xsl:attribute>
  236.                                     <xsl:attribute name="height">2</xsl:attribute>
  237.                                 </xsl:element>
  238.                             </td>
  239.                             <td class="bm"></td>
  240.                             <td class="br">
  241.                                 <xsl:element name="img">
  242.                                     <xsl:attribute name="src"><xsl:copy-of select="$stylepath"/>/img/tbl/shim.gif</xsl:attribute>
  243.                                     <xsl:attribute name="width">2</xsl:attribute>
  244.                                     <xsl:attribute name="height">2</xsl:attribute>
  245.                                 </xsl:element>
  246.                             </td>
  247.                         </tr>
  248.                 
  249.                     </table>
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.   
  259. </body></html>
  260. </xsl:template>
  261.  
  262. <xsl:template match="news">
  263.  <TR>
  264.     <TD class="normalbig">
  265.         <xsl:element name="div">
  266.             <xsl:attribute name="class"><xsl:value-of select="type" /></xsl:attribute>
  267.             <xsl:value-of select="date" />
  268.         </xsl:element>
  269.     
  270.     
  271.         
  272.     </TD>
  273.     <TD style="white-space: nowrap;" class="normalbig">
  274.         <xsl:element name="a">
  275.             <xsl:attribute name="href">javascript:window.external.OpenNews(<xsl:value-of select="id" />);</xsl:attribute>
  276.             <xsl:attribute name="alt"><xsl:value-of select="url" /></xsl:attribute>
  277.             <xsl:value-of select="title" />
  278.         </xsl:element>
  279.     </TD>
  280.  
  281.  </TR>
  282. </xsl:template>
  283.  
  284.  
  285.  
  286.  
  287.  
  288. </xsl:stylesheet>
  289.